// // 构造函数继承
// var Person = function () {
//     this.name = "lyy"
//     this.age = 25
// }
// var Student = function (address) {
//     this.addr = address
// }
// Student.prototype = new Person()
// var stu = new Student()
// console.log(stu);

// 偷窃继承
// var Person = function (name, age) {
//     this.name = name
//     this.age = age
// }
// var Student = function (name, age, addr) {
//     Person.call(this, name, age)
//     this.addr = addr
// }
// Student.prototype = new Person()
// var stu = new Student('lyy', 25, '北京市')
// console.log(stu);
// 原型链继承
var Person = function (name, age) {
    this.name = name
    this.age = age
}
Person.prototype.friends = ['1','2','3']
var Student = function (name, age, addr) {
    Person.call(this, name, age)
    this.addr = addr
}
Student.prototype = Person.prototype
var stu = new Student('lyy', 25, '北京市')
var stu1 = new  Student('ss0',12,'asd')
console.log(stu);
console.log(stu1);